<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="css/adminstyle.css" />
</head>

<?PHP
session_start();
include("../config/connect.php");
include("../public/common.php");

$ref = CheckUrlParamNoDie("ref");
if($ref=="") $ref="view_items.php";
$email = trim(GetPostParamStr("email"));
$psw = trim(GetPostParamStr("psw"));

$bOK = 0;	
if( $email != "" && $psw != "" )
{
	$sql = "select * from tsj_user where email='$email' limit 1";
	$result = mysql_query( $sql );
	if (mysql_num_rows($result) > 0)
	{
		//
		$row = mysql_fetch_assoc( $result );
		if ($row["password"] != "")
		{
			echo md5($psw);
			if (md5($psw) == $row["password"])
			{
				$_SESSION["isoauth"] = 0;
				$_SESSION["email"] = $email;
				$_SESSION["userid"] = $row["id"];
				$_SESSION["nickname"] = $row["nick_name"];
				$_SESSION["right"] = $row["right"];
				
				$url = "Location:".$ref;
				header($url);
			}
			else
			{
				echo "<script>alert('密码错误！');</script>";
			}
		}
		else
		{
			echo md5($psw);
			echo "<script>alert('您没有升级账号，不能分享！');</script>";
		}
	}
	else
	{
		echo "<script>alert('不存在的账号！');</script>";
	}
}

?>

<body>
<div id="wrapper">
<div class="login_main">
<form action="login.php?ref=<?PHP echo $ref; ?>" method="post" id="RegId">
	<div class="lo_nn">
    	<div class="lo_user"><div class="s1 left">注册邮箱：</div><div class="in1 left"><input name="email" tabindex="1" width="200" type="text"></div></div>
		<div class="lo_user"><div class="s1 left">密码：</div><div class="in1 left"><input name="psw" tabindex="2" width="200" type="password"></div></div>
    	<div class="lo_btn"><input type="submit" value="" /></div>
    </div>
</form>
	<div style="position: absolute; left: 135px; bottom: 24px; color:#84AFD1;">冰峰科技旗下兔丝街 Copyright ©2011 tusijie.com 粤ICP备11071450号</div>
<div>
</div>
</body>
</html>